package owg.util.editor2d.modes;

import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;

import owg.util.editor2d.Editor2D;
import owg.util.opengl.EGL;

public abstract class Mode {

    public final Editor2D editor;
    
    public Mode(Editor2D e)
    {
	this.editor = e;
    }
    /**Called before rendering the mouse cursor
     * @param egl */
    public abstract void render(EGL<?> egl);
    /**Called when a mouse event happens while the mode is active.
     * Note: If the mode is initiated by a mouse action, then that event <b>will</b> be delivered here.*/
    public abstract void mouse(MouseEvent e);
    /**Called when a key event happens while the mode is active.
     * Note: If the mode is initiated by a keyboard action, then that event will <b>not</b> be delivered here.*/
    public abstract void key(KeyEvent e);
    /**Called when the editor demands that the mode ends.*/
    public abstract void terminate(boolean cancel);
    /**Called when the user scrolls with the mouse wheel*/
	public void wheel(MouseWheelEvent e)
	{}
	
	public abstract boolean shouldUpdateHighlight();
}
